//
//  AccountSaveVC.m
//  EPTool
//
//  Created by guoshiqing on 2018/4/25.
//  Copyright © 2018年 云数动能科技. All rights reserved.
//

#import "AccountSaveVC.h"
#import "BottomTopLineTableViewCell.h"
#import "MobileResetVC.h"
#import "PasswordResetVC.h"
#import "AccountSysVM.h"

#define AccountAndSaveMobile   @"手机号"
#define AccountAndSavePassword @"登录密码"

@interface AccountSaveVC ()

@end

@implementation AccountSaveVC

- (void)viewDidLoad {
    
    self.textList = @[@[AccountAndSaveMobile, AccountAndSavePassword]];

    self.tableView.bounces = NO;
    self.tableView.scrollEnabled = NO;
    
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    NSString *strSelected = @"";
    NSArray *subList = [self.textList objectAtIndex:indexPath.section];
    if ([subList isKindOfClass:[NSArray class]]) {
        strSelected = [subList objectAtIndex:indexPath.row];
    }
    else
    {
        strSelected = [self.textList objectAtIndex:indexPath.section];
    }
    
    if ([strSelected isEqualToString:AccountAndSaveMobile]) {
        [MobClick event:@"click_ios_PersonalCenterVC_Set_AccountSave_MobileNumber"];
        MobileResetVC *mobileVC = [[MobileResetVC alloc] init];
        mobileVC.baseVM = [[AccountSysVM alloc] init];
        [self.navigationController pushViewController:mobileVC animated:YES];
    }
    if ([strSelected isEqualToString:AccountAndSavePassword]) {
        [MobClick event:@"click_ios_PersonalCenterVC_Set_AccountSave_Password"];
        PasswordResetVC *pwdVC = [[PasswordResetVC alloc] init];
        pwdVC.baseVM = [[AccountSysVM alloc] init];
        [self.navigationController pushViewController:pwdVC animated:YES];
    }
}

@end
